package com.canbot.u05.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.canbot.u05.R;
import com.canbot.u05.activity.presidemode.newcode.NHostTaskListActivity;
import com.canbot.u05.socket.MsgSendUtils;
import com.canbot.u05.socket.MsgType;


/**
 * 手持pad  控制中心
 */
public class ControlCenterActivity extends BaseActivityNoTitle implements View.OnClickListener {


        private ControlCenterActivity mContext;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.act_control_center);
                mContext = this;
                findViewById(R.id.btn_back_control).setOnClickListener(this);
                findViewById(R.id.icon_script_edit).setOnClickListener(this);
                findViewById(R.id.icon_handle).setOnClickListener(this);
                findViewById(R.id.icon_voice).setOnClickListener(this);
                findViewById(R.id.icon_show).setOnClickListener(this);
        }

        @Override
        public void onClick(View view) {
                switch (view.getId()) {
                        case R.id.btn_back_control:
                                MsgSendUtils.sendStringMsgToPad(MsgType.RECEIVER_MSG_FINISH_ACTIVITY, "7");
                                finish();
                                break;
                        case R.id.icon_script_edit:
                                startotherActivity(mContext, NHostTaskListActivity.class);
                                break;
                        case R.id.icon_handle:
                                startotherActivity(mContext, HandleTelecontrolActivity.class);
                                break;
                        case R.id.icon_voice:
                                startotherActivity(mContext, ActionDanceActivity.class);
                                break;
                        case R.id.icon_show:
                                startotherActivity(mContext, SpeechGenerationActivity.class);
                                break;
                        default:
                                break;


                }


        }

        /**
         * 跳转到其他activity
         */
        protected void startotherActivity(Context context, Class<?> cls) {
                Intent intent = new Intent(context, cls);
                startActivity(intent);
        }
}
